<template>
  <div class="remotecontrol">
    <div class="con">
      <!-- <div class="Files-top">
        <div class="ic-left">
          <span>遥控配置</span>
        </div>
        <div class="btns">
          <el-button type="primary" @click="addGroup_fn" class="last-el-button">新增</el-button>
        </div>
      </div> -->
      <div class="search-input-btn" style="width:100%">
          <div class="my-search-i">
            <div class="input-small">
              <span>名称：</span>
              <el-input v-model="searchName" clearable placeholder="请输入名称"></el-input>
            </div>

            <el-button type="primary" plain  @click="search_fn" style="margin-left:12px">查询</el-button>
          
          </div>
            <el-button type="primary" @click="addGroup_fn" class="last-el-button">新增</el-button>
      </div>
      <div class="mytable" style="height:calc(100% - 105px)">
        <el-table id="demo" height="100%" v-loading="loading" stripe :data="tableData" style="width: 100%">
          
          <el-table-column label="序号" width="60" align="center" type='index'></el-table-column>
          <el-table-column prop="name" label="名称"> </el-table-column>
          <el-table-column prop="operationGroupId" label="ID"> </el-table-column>
          <el-table-column prop="code" label="操作区域">
            <template #default="{row}">
              <span v-if="row.area == 0">默认区域</span>
              <span v-else></span>
            </template>
          </el-table-column>
          <el-table-column prop="name" label="操作设备"> </el-table-column>
          <el-table-column prop="pointName" label="操作关联变量"> </el-table-column>
          <el-table-column prop="lockVariableName" label="闭锁关联变量"> </el-table-column>
          <el-table-column prop="operationPage" label="操作界面"> </el-table-column>
          <el-table-column label="操作" align="center" width="300">
            <template #default="{row}">
              <div class="btnssss" style="display: flex;justify-content: center; align-items: center;">
                <span style="color:#368ED9" @click="clickTerm_fn(row)">操作项</span>
                <span class="line"></span>
                <span style="color:#368ED9" @click="edit_ed(row)">编辑</span>
                <span class="line"></span>
                <span style="color:#FF1D1D" @click="delGroup_fn(row)">删除</span>
                <span class="line"></span>

              </div>

            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="divider-line"></div>
      <div class="paging">
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
          background :page-sizes="[15, 25, 35, 45, 55]" :page-size="15" layout="total, sizes, prev, pager, next, jumper"
          :total="total">
        </el-pagination>
      </div>
      <!-- 新增修改操作组（第一层表格） -->
      <el-dialog width="700px" draggable :title="textMap[dialogStatus]" :close-on-click-modal='false'
        v-model="dialogVisible">
        <div style="display: flex;width:100%;height:500px">
          <div class="lefttree" style="width:270px;height:100%;margin-right:12px;border-right:1px solid #EBEBEB">
               <el-scrollbar style="height:100%;width: 100%;">
                  <el-tree class="filter-tree" :data="treeList" node-key="keyId" :props="defaultProps2"
                    :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current ref="tree" show-checkbox @check="handleCheckChange">
                    <template   #default="{ node }">
                        <div class="custom-tree-node">
                        <img src="../../../public/static/image/elTree/1.9.png" style="margin-right: 2px;"
                          v-if="node.data.Content.Category && node.data.Content.Category == 'Organization'" />

                        <img src="../../../public/static/image/elTree/variable.png" style="margin-right: 2px;"
                          v-if="node.data.Content.variableName" />

                        <img src="../../../public/static/image/elTree/2.1.png"
                          style="margin-right: 2px; position: relative;top: 1px;"
                          v-if="node.data.Content.Category &&  node.data.Content.Category == 'Device'" />
                        <span style="padding-left: 5px;">{{node.data.Content.Name}}</span>
                      </div>
                    </template>
                  </el-tree>
                </el-scrollbar>
          </div>
          <div class="rightitem" style="width: calc(100% - 285px);height:100%;">
            
             <div class="inputitem">
                  <div class="leftname">操作关联变量：</div>
                  <el-input v-model="nowVariable.pointName" disabled></el-input>
              </div>
              <div class="inputitem">
                  <div class="leftname">操作设备：</div>
                  <el-input v-model="nowVariable.caoname" disabled></el-input>
              </div>
              <div class="inputitem">
                  <div class="leftname">名称：</div>
                  <el-input v-model="nowVariable.myname"></el-input>
              </div>
              <div class="inputitem">
                  <div class="leftname">操作界面：</div>
                   <el-select v-model="nowVariable.myinterface" placeholder="请选择" clearable>
                      <el-option v-for="item in interfaceList" :key="item.value" :label="item.name" :value="item.value">
                      </el-option>
                   </el-select>
              </div>
              
          </div>
        
        </div>
        <template #footer>
                  <div class="dialog-footer">
                    <el-button @click="dialogVisible = false">取 消</el-button>
                    <el-button type="primary" @click="dialogStatus==='edit'?groupEdit_fn('temp'):groupAdd_fn('temp')">确 定</el-button>
                  </div>
       </template>
      </el-dialog>
      <!-- 新增修改操作组（第一层表格） -->
      <el-dialog width="500px" draggable :title="textMap[dialogStatus]" :close-on-click-modal='false'
        v-model="dialogVisibleedit">
        <div style="display: flex;width:100%;height:500px">
          <el-form :model="temp" ref="temp" style="width: 100%;height:410px;padding-top: 10px;">
            <!-- <el-form-item label="ID：" prop="operationGroupId">
              <el-input v-model="temp.operationGroupId"></el-input>
            </el-form-item>
            <el-form-item label="操作区域：" prop="area">
              <el-select v-model="myarea" placeholder="请选择" clearable>
                <el-option v-for="item in areaList" :key="item.value" :label="item.name" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item> -->
            <el-form-item label="操作关联变量：" prop="pointName" style="dis">
              <el-input v-model="temp.pointName" disabled></el-input>
              <el-button type="primary" class="last-el-button" @click="openVariableDio('operate')"
                style="margin-left:10px;height: 36px;padding">选择</el-button>
            </el-form-item>
            <el-form-item label="操作设备：" prop="name">
              <el-input v-model="caoname" disabled></el-input>
            </el-form-item>
            <el-form-item label="名称：" prop="name">
              <el-input v-model="temp.name"></el-input>
            </el-form-item>
            <!-- <el-form-item label="闭锁关联变量：" prop="lockVariableName">
              <el-input v-model="temp.lockVariableName" disabled></el-input>
              <el-button type="primary" class="last-el-button" @click="openVariableDio('lock')"
                style="margin-left:10px;height: 36px;padding">选择</el-button>
            </el-form-item> -->
            <el-form-item label="操作界面：" prop="operationPage">
              <el-select v-model="myinterface" placeholder="请选择" clearable>
                <el-option v-for="item in interfaceList" :key="item.value" :label="item.name" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>

          </el-form>
        </div>
         <template #footer>
                  <div class="dialog-footer">
                    <el-button @click="dialogVisibleedit = false">取 消</el-button>
                    <el-button type="primary" @click="groupEdit_fn('temp')">确 定</el-button>
                  </div>
         </template>
        
      </el-dialog>

      <!-- 设备关联变量点 -->
      <el-dialog width="500px" draggable title="选择关联变量点" :close-on-click-modal='false' v-model="variableDio">
        <div style="display: flex;">
          <el-scrollbar style="height:500px;width: 100%;">
            <el-tree class="filter-tree" :data="treeList" node-key="keyId" :props="defaultProps2"
              :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current ref="tree">
              <template  #default="{ node }">
                <div class="custom-tree-node">
                <img src="../../../public/static/image/elTree/1.9.png" style="margin-right: 2px;"
                  v-if="node.data.Content.Category && node.data.Content.Category == 'Organization'" />

                <img src="../../../public/static/image/elTree/variable.png" style="margin-right: 2px;"
                  v-if="node.data.Content.variableName" />

                <img src="../../../public/static/image/elTree/2.1.png"
                  style="margin-right: 2px; position: relative;top: 1px;"
                  v-if="node.data.Content.Category &&  node.data.Content.Category == 'Device'" />
                <span style="padding-left: 5px;">{{node.data.Content.Name}}</span>
                </div>
              </template>
            </el-tree>
          </el-scrollbar>
        </div>
         <template #footer>
                  <div class="dialog-footer">
                    <el-button @click="variableDio = false">取 消</el-button>
                    <el-button type="primary" @click="variable_fn" class="last-el-button">确 定</el-button>
                  </div>
         </template>
        
      </el-dialog>

      <!-- 操作项（弹窗层表格） -->
      <el-dialog width="1050px" draggable :title="dioTitle" :close-on-click-modal='false'
        v-model="dialogVisibleTerm">
        <div class="caozuoxiang">
          <div class="Files-top">
            <div class="ic-left">
              <span></span>
            </div>
            <div class="btns">
              <el-button type="primary" class="last-el-button" @click="addTermDio_fn">新增操作项</el-button>
            </div>
          </div>
          <div style="width:100%;height:400px">
          <el-table id="demo" height="100%" v-loading="termLoading" stripe :data="tableTermData"
            style="width: 100%">
            
            <el-table-column label="序号" width="60" align="center" type='index'></el-table-column>
            <el-table-column prop="name" label="操作名称"> </el-table-column>
            <el-table-column prop="beginStatus" label="操作前状态"> </el-table-column>
            <el-table-column prop="endStatus" label="操作后状态"> </el-table-column>
            <el-table-column prop="operationAddr" label="操作地址"> </el-table-column>
            <el-table-column prop="operationAddr1" label="开关类型">
                <template #default="{row}">
                <div v-show="row.operationAddr1 == 1">开</div>
                <div v-show="row.operationAddr1 == 0">关</div>
              </template>
            </el-table-column>
            <el-table-column prop="selectAddr" label="选择地址"> </el-table-column>
            <el-table-column label="操作" align="center" width="200">
              <template #default="{row}">
                <div class="public-flex">
                  <div @click="editTermDio_fn(row)" class="mr-20">
                   编辑
                  </div>
                  <div @click="delTerm_fn(row)" style="color:red">
                    删除
                  </div>
                </div>
              </template>
            </el-table-column>
          </el-table>
          </div>
        </div>
        <template #footer>
                  <div class="dialog-footer">
                     <el-button @click="dialogVisibleTerm = false">取 消</el-button>
                  </div>
         </template>
        
      </el-dialog>

      <!-- 新增修改操作项 -->
      <el-dialog width="500px" draggable :title="textMapTermdio" :close-on-click-modal='false'
        v-model="dioVisibleTerm">
        <div style="display: flex;">
          <el-form :model="tempTerm" ref="tempTerm" style="width: 90%;height:410px;padding-top: 10px;">
            <el-form-item label="操作项名称：" prop="name">
              <el-input v-model="tempTerm.name"></el-input>
            </el-form-item>
            <el-form-item label="操作前状态值：" prop="beginStatus">
              <el-input v-model="tempTerm.beginStatus"></el-input>
            </el-form-item>

            <el-form-item label="操作后状态值：" prop="endStatus">
              <el-input v-model="tempTerm.endStatus"></el-input>
            </el-form-item>
            <el-form-item label="操作地址：" prop="operationAddr">
              <el-input v-model="tempTerm.operationAddr"></el-input>
            </el-form-item>
            <el-form-item label="开关类型：" prop="operationAddr1">
              <el-radio v-model="tempTerm.operationAddr1" label="1">开</el-radio>
              <el-radio v-model="tempTerm.operationAddr1" label="0">关</el-radio>
            </el-form-item>
            <el-form-item label="选择地址：" prop="selectAddr">
              <el-input v-model="tempTerm.selectAddr"></el-input>
            </el-form-item>
          </el-form>
        </div>
        <template #footer>
                  <div class="dialog-footer">
                     <el-button @click="dioVisibleTerm = false">取 消</el-button>
                     <el-button type="primary" @click="dialogStatusTerm==='edit'?termEdit_fn('tempTerm'):termAdd_fn('tempTerm')">确 定</el-button>
                  </div>
         </template>
        
      </el-dialog>



    </div>
  </div>
</template>

<script>
import { useCounterStore } from '../../stores/counter'
  import {statementVariableTree,operationGroupList,operationList,saveOperationListGroup,delOperationListGroup,saveOperationList,delOperationList,vagueOperationGroupList} from "../../api/abbNewApi";
  export default {
    data () {
      return {
        dialogVisibleedit:false,
        searchName: "",
        loading: false,
        termLoading: false,
        tableData: [],
        dialogVisible: false,
        dialogStatus: 'add',
        textMap: {
          add: "新增操作组",
          edit: "编辑操作组"
        },
        temp: {},

        dioTitle: "操作项",
        dialogVisibleTerm: false,
        total: 0,
        currentPage: 1,
        currentSize: 15,

        //默认区域
        areaList: [
          {
            name: "默认区域",
            value: 0
          }
        ],
        myarea: "",

        //操作界面
        myinterface: "",
        interfaceList: [
          {
            name: "遥调",
            value: "遥调",
          },
          {
            name: "双点遥控执行",
            value: "双点遥控执行",
          },
          {
            name: "遥控执行",
            value: "遥控执行",
          },
          {
            name: "遥控选择执行",
            value: "遥控选择执行",
          },
        ],

        //设备关联变量点
        variableDio: false,
        defaultProps2: {
          children: 'ChildDatas',
          label: 'Content.Name'
        },
        checkedNodes:[],
        treeList: [],
        treeListCopy: [],
        nowVariable: "",
        nowVariableType: "",
        deviceArr: [],

        //操作项
        tableTermData: [],
        dioVisibleTerm: false,
        tempTerm: {},
        dialogStatusTerm: 'add',
        textMapTermdio: "",
        nowGroup: {},
        caoname:"",




      };
    },

    mounted () {
      this.getList()
      this.treeList_fn()
    },
    //利用计算属性
    computed: {
      unitId () {
        return useCounterStore().getNowUnit
      }
    },
    watch: {
      unitId (val) {
        console.log("侦听1",val);
      }
    },

    methods: {

      //查询
      search_fn () {
        if(this.searchName=="") {
          this.getList()
        } else {
          var d={
            pageNum: this.currentPage,
            pageSize: this.currentSize,
            telecontrolName: this.searchName
          }
          this.loading=true
          vagueOperationGroupList(d).then(res => {
            this.loading=false
            if(res.code==200) {
              this.tableData=res.data.content;
              this.total=res.data.totalElements;
            }
          })
        }
      },
      //获取操作组的表格数据
      getList () {
        var d={
          pageNum: this.currentPage,
          pageSize: this.currentSize,
        }
        this.loading=true
        operationGroupList(d).then(res => {
          // console.log("操作组的数据",res);
          this.loading=false
          if(res.code==200) {
            this.tableData=res.data.content;
            this.total=res.data.totalElements;
          }
        })
      },
      //点击操作组弹出操作项表格
      clickTerm_fn (row) {
        this.nowGroup=row
        this.dioTitle=`操作项 （${row.name}）`
        this.dialogVisibleTerm=true
        this.termLoading=true
        operationList({groupNo: row.no}).then(res => {
          this.termLoading=false
          if(res.code==200) {
            this.tableTermData=res.data
          } else {
            if(res.message) {
              this.$message.error(res.message);
            } else {
              this.$message.error('获取失败！！');
            }
          }
        })
      },
      //操作项列表
      operationList_fn (row) {
        this.termLoading=true
        operationList({groupNo: row.no}).then(res => {
          this.termLoading=false
          if(res.code==200) {
            this.tableTermData=res.data
          } else {
            if(res.message) {
              this.$message.error(res.message);
            } else {
              this.$message.error('获取失败！！');
            }
          }
        })
      },
      //添加操作组弹窗
      addGroup_fn () {
        this.dialogStatus='add';
        this.dialogVisible=true;
        this.$nextTick(() => {
          // this.$refs["temp"].clearValidate();
        });
        this.temp={};
      },
      //操作组添加
      groupAdd_fn () {
        var dd = []
        if(this.checkedNodes.length == 0){
           this.$message({showClose: true,message: '请选择需要增加的变量',type: 'warning'});
           return
        }
         var nowRow=[]
        this.checkedNodes.forEach(item => {
         nowRow =  this.deviceArr.filter(tt => item.caoname == tt.Content.Name)
            dd.push({
               area:0,
               name:item.myname,
               pointName:item.pointName,
               entityName:"OperationGroup",
               operationPage:item.myinterface,
               device:nowRow[0].Content.Id,
            })
        })
        // console.log("参数",dd);
        saveOperationListGroup(dd).then(res => {
              if(res.code==200) {
                 this.dialogVisible=false
                this.getList()
                this.treeList_fn()
                this.$message({showClose: true,message: '添加操作组成功',type: 'success'});
              } else {
                if(res.message) {
                  this.$message.error(res.message);
                } else {
                  this.$message.error('添加失败');
                }
              }
             
            })
      },
      //修改操作组弹窗
      edit_ed (v) {
        this.dialogStatus="edit";
        this.temp=Object.assign({},v);

        this.dialogVisibleedit=true;
        this.$nextTick(() => {
          this.$refs["temp"].clearValidate();
        });
        this.myarea = v.area
        this.caoname = v.name
        this.myinterface = v.operationPage
      },
      //删除操作组
      delGroup_fn (row) {
        this.$confirm(`是否删除 ${row.name}`,'提示',{
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          delOperationListGroup({"no": row.id}).then(res => {
            if(res.code==200) {
              this.$message({showClose: true,message: '删除成功',type: 'success'});
              this.getList();
            } else {
              res.message? this.$message.error(res.message):this.$message.error('删除失败');
            }
          })
        }).catch(() => {
          // ...
        });
      },

      //确定操作组修改
      groupEdit_fn () {
        this.$refs['temp'].validate(valid => {
          if(valid) {
            this.temp.area=this.myarea
            this.temp.operationPage=this.myinterface
            saveOperationListGroup([this.temp]).then(res => {
              if(res.code==200) {
                this.getList()
                this.dialogVisibleedit = false
                this.$message({showClose: true,message: '修改操作组成功',type: 'success'});
              } else {
                if(res.message) {
                  this.$message.error(res.message);
                } else {
                  this.$message.error('修改失败');
                }
              }
            })
          } else {
            return false;
          }
        });
      },

      //添加操作项弹窗
      addTermDio_fn () {
        this.dialogStatusTerm='add';
        this.dioVisibleTerm=true;
        this.textMapTermdio=`新增操作项 （${this.nowGroup.name}）`
        this.$nextTick(() => {
          this.$refs["tempTerm"].clearValidate();
        });
        this.tempTerm={};
      },
      //确定新增操作项
      termAdd_fn (formName) {
        this.$refs[formName].validate(valid => {
          if(valid) {
            this.tempTerm.entityName="Operation"
            this.tempTerm.operationGroup=this.nowGroup.no
            saveOperationList(this.tempTerm).then(res => {
              if(res.code==200) {
                this.operationList_fn(this.nowGroup)
                this.dioVisibleTerm=false
                this.$message({showClose: true,message: '添加操作组成功',type: 'success'});
              } else {
                if(res.message) {
                  this.$message.error(res.message);
                } else {
                  this.$message.error('添加失败！！');
                }
              }

            })
          } else {
            return false;
          }
        });
      },
      editTermDio_fn (v) {
        this.dialogStatusTerm="edit";
        this.tempTerm=Object.assign({},v);
        this.textMapTermdio=`修改操作项 （${v.name}）`
        this.dioVisibleTerm=true;
        this.$nextTick(() => {
          this.$refs["tempTerm"].clearValidate();
        });
      },
      //修改操作项
      termEdit_fn () {
         saveOperationList(this.tempTerm).then(res => {
              if(res.code==200) {
                this.operationList_fn(this.nowGroup)
                this.dioVisibleTerm=false
                this.$message({showClose: true,message: '修改操作组成功',type: 'success'});
              } else {
                if(res.message) {
                  this.$message.error(res.message);
                } else {
                  this.$message.error('修改失败！！');
                }
              }

            })
      },
      //删除操作项
      delTerm_fn (row) {
        this.$confirm(`是否删除操作项 ${row.name}`,'提示',{
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          delOperationList({"no": row.no}).then(res => {
            if(res.code==200) {
              this.operationList_fn(this.nowGroup)
              this.$message({showClose: true,message: '删除成功',type: 'success'});
            } else {
              res.message? this.$message.error(res.message):this.$message.error('删除失败');
              // this.$message.error('删除失败');
            }
          })
        }).catch(() => {
          // ...
        });

      },


      handleSizeChange (val) {
        this.currentSize=val;
        this.getList();
      },
      handleCurrentChange (val) {
        this.currentPage=val;
        this.getList();
      },

      //打开关联变量点树形弹窗
      openVariableDio (val) {
        this.nowVariableType=val
        this.variableDio=true
      },
      //获取关联变量点
      treeList_fn () {
        statementVariableTree({"unitId": this.unitId.id}).then(res => {
          if(res.code==200) {
            this.treeListCopy=[res.data]
            this.handleData(res)
            this.handleDataCopy(this.treeListCopy)
            // console.log(res);
            // this.treeList = [res.data]
          }
        })
      },
      //处理企业数据
      handleData (data) {
        data=JSON.parse(JSON.stringify(data).replace(/appTypes/g,'ChildDatas').replace(/groupName/g,"Name").replace(/groupIdAndName/g,"Content").replace(/groupId/g,"Id").replace(/appTypeInfo/g,"Content"))

        var recursiveFunction=function() {
          const getStr=function(list) {
            list.forEach(function(row) {
              if(row.ChildDatas.length != 0) {
                // console.log("row.ChildDatas",row);
                getStr(row.ChildDatas)
              } else {
                row.Content.groups.forEach(tt => {
                    // tt.ChildDatas = tt.ChildDatas.filter(ttt => ttt.Content.appType == 232)
                    tt.ChildDatas.forEach(item => {
                      item.Content.Name = item.Content.variableName
                      var nameArr = item.Content.variableName.split(".")
                      item.myname = nameArr[0]
                      item.caoname = nameArr[0]
                      item.pointName = item.Content.variableName
                      item.lockVariableName = ""
                      item.myinterface = ""
                    })
                })
                row.ChildDatas = row.Content.groups
              }
            })
          }
          getStr([data.data])
        }
        recursiveFunction()



        // var abc = 	[a.data].filter(item => item.Content.groups.hasOwnProperty('groupIdAndName'))
        this.treeList= [data.data]
        // console.log("this.treeList",this.treeList);



      },
      //把设备合并到一个数组
      handleDataCopy (list) {
        var arr=[]
        var recursiveFunction=function() {
          const getStr=function(list) {
            list.forEach(function(row) {
              if(row.ChildDatas.length!=0) {
                if(row.Content.Category=='Device') {
                  arr.push(row)
                }
                getStr(row.ChildDatas)
              } else {
                if(row.Content.Category=='Device') {
                  arr.push(row)
                }
                // row.ChildDatas = row.Content.groups
              }
            })
          }
          getStr(list)
        }
        recursiveFunction()

        this.deviceArr = arr
      },
      //树形结构点击
      handleNodeClick (row) {
        this.nowVariable = row
        if(row.Content.variableName){
            // var nameArr = row.Content.variableName.split(".")
            // console.log("nameArr",nameArr);
            // row.myname = nameArr[0]
            // row.pointName = row.Content.variableName
            // row.lockVariableName = "3"
            // row.myinterface = "4"
        }else {
           row.myname = ""
            row.pointName = ""
            row.lockVariableName = ""
            row.myinterface = ""
        }
      },
      handleCheckChange(data, checked, indeterminate){
        // console.log(data, checked, indeterminate)
        this.checkedNodes = checked.checkedNodes.filter(item => item.Content.variableName)
      },
      //树形结构(关联变量点) 确定操作
      variable_fn () {
        var nowData=this.nowVariable
        if(nowData.Content.appType) {
          var nameArr=nowData.Content.variableName.split(".")
          var nowRow=this.deviceArr.filter(item => nameArr[0]==item.Content.Name)
          this.temp.name=nameArr[0]
          this.temp.entityName='OperationGroup'
          if(this.nowVariableType=='lock') { //闭锁
            this.temp.lockDevice=nowRow[0].Content.Id
            this.temp.lockVariableName=nowData.Content.variableName
          } else {
            this.temp.pointName=nowData.Content.variableName
            this.temp.device=nowRow[0].Content.Id
          }
          this.variableDio=false

        } else {
          this.$message({showClose: true,message: '请选择变量！！',type: 'warning'});
        }
      },
      //树形结构筛选
      filterNode (value,data) {
        if(!value) return true;
        // console.log(data.Content.Name.indexOf(value) !== -1);
        return data.Content.Name.indexOf(value)!==-1;
        // return data.Content.Name == value;
      },
    },
  };
</script>

<style lang="scss" scoped>
.search-input-btn {
   width: 100%;
   display: flex;
   align-items: center;
   justify-content: space-between;
   :deep(.el-input) {
     height: 32px;
     line-height: 32px;
   }
}
  .remotecontrol {
    .line {
      margin: 0px 12px;
      display: inline-block;
      width: 1px;
      height: 18px;
      background-color: #E6E6E6;
    }

    .con {
      width: 100%;
      height: 100%;
      padding: 12px 20px;
      background-color: #fff;
      box-sizing: border-box;

      .public-flex {
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .paging {
        display: flex;
        justify-content: flex-end;
        margin-top: 10px;
      }

      .caozuoxiang {
        padding-bottom: 30px;
      }
    }

    :deep(.el-dialog__header) {
      display: flex;
      align-items: center;
      border-bottom: 1px solid #E6E6E6;

      span {
        color: #67A3ED;
        font-size: 14px;
        font-weight: bold;
      }

      .el-icon-close {
        font-size: 20px !important;
      }

    }

    :deep(.el-form-item__content) {
      display: flex;
      align-items: center;
      height: 36px;
      flex-wrap: nowrap;
      line-height: 36px;
    }

    :deep(.el-dialog__footer) {
      text-align: right !important;
      border-top: 1px solid #E6E6E6;

      button {
        padding: 8px 17px;
      }
    }

    .demo-temp {
      display: flex;
      flex-wrap: wrap;
    }

    :deep(.el-form-item) {
      display: flex;

      .el-input__inner {
        width: 240px;
      }

      //   margin-left: 20px;
    }

    :deep(.el-form-item__label) {
      white-space: nowrap;
      width: 105px;
      padding: 0px;
    }

    :deep(.el-dialog__body) {
      padding: 20px !important;
    }

  }
  .rightitem {
     .inputitem {
       display: flex;
       align-items: center;
       margin-bottom: 20px;
       .leftname {
        //  width: ;
        white-space: nowrap;
        width: 100px;
        min-width: 100px;
        text-align: right;
       }
     }
  }
</style>